<template>
  <div
    ref="radarChart"
    class="radar-chart"
  ></div>
</template>

<script>
import * as echarts from 'echarts/core'
import { TitleComponent, LegendComponent } from 'echarts/components'
import { RadarChart } from 'echarts/charts'
import { CanvasRenderer } from 'echarts/renderers'

echarts.use([TitleComponent, LegendComponent, RadarChart, CanvasRenderer])

export default {
  name: 'RadarChart',
  components: {},
  props: {},
  data () {
    return {

    }
  },
  // 计算属性
  computed: {},
  // 侦听器
  watch: {},
  created () { },
  mounted () {
    const myChart = echarts.init(this.$refs.radarChart)
    myChart.setOption({
      title: {
        text: '雷达图'
      },
      legend: {
        data: ['刘永超', '小倩']
      },
      radar: {
        // shape: 'circle',
        name: {
          textStyle: {
            color: '#fff',
            backgroundColor: '#999',
            borderRadius: 3,
            padding: [3, 5]
          }
        },
        indicator: [
          { name: '工作效率', max: 100 },
          { name: '考勤', max: 100 },
          { name: '积极性', max: 100 },
          { name: '帮助同事', max: 100 },
          { name: '自主学习', max: 100 },
          { name: '正确率', max: 100 }
        ]
      },
      series: [
        {
          name: 'Budget vs spending',
          type: 'radar',
          data: [
            {
              value: [100, 50, 100, 100, 100, 100],
              name: '刘永超'
            },
            {
              value: [50, 50, 50, 50, 50, 10],
              name: '小倩'
            }
          ]
        }
      ]
    })
  },
  methods: {}
}
</script>

<style scoped>
.radar-chart {
  width: 100%;
  height: 400px;
}
</style>
